|
2020-2021 Sunseeker Telemetry and Lighting System
|
#include "driverlib.h"Go to the source code of this file.
Macros | |
| #define | TIMER_A_PERIOD 0xFFFF |
| #define | UCS_MCLK_DESIRED_FREQUENCY_IN_KHZ 12000 |
| #define | UCS_MCLK_FLLREF_RATIO 374 |
Functions | |
| void | main (void) |
| void | TIMER_A (void) |
Variables | |
| Timer_A_initUpModeParam | initUpModeParam = {0} |
| #define TIMER_A_PERIOD 0xFFFF |
COMPB - TA0.1, TA1.1, Varying duty cycle of input voltage
Use CompB to determine if input, Vcompare has a duty cycle greater than 50%. When Vcompare exceeds Vcc*3/4 then TimerA0 captures the time (TA0CCR1). When Vcompare is less than Vcc*1/4 then TimerA1 captures the time (TA1CCR1) and resets the timers for TIMERA0 and TIMERA1. If TA0CCR1 is greater than TA1CCR1/2, then turn on the LED. If TA0CCR1 is less than TA1CCR1/2, then turn off the LED. Clocks: ACLK = REFO; MCLK = SMCLK = 12MHz
MSP430x552x ------------------
/|| | | | | –|RST P6.0/CB0|<- Vcompare (200Hz<f<1Mhz) (vary dutycycle) | P1.0|-> LED ('ON' if dutycycle > 50%; | | 'OFF' if dutycycle < 50%)
This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:
This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.
Definition at line 67 of file comp_b_ex5_TAx.c.
| #define UCS_MCLK_DESIRED_FREQUENCY_IN_KHZ 12000 |
Definition at line 68 of file comp_b_ex5_TAx.c.
| #define UCS_MCLK_FLLREF_RATIO 374 |
Definition at line 69 of file comp_b_ex5_TAx.c.
| void main | ( | void | ) |
Definition at line 73 of file comp_b_ex5_TAx.c.
References __delay_cycles(), __no_operation(), initUpModeParam, TIMER_A_PERIOD, UCS_MCLK_DESIRED_FREQUENCY_IN_KHZ, and UCS_MCLK_FLLREF_RATIO.
| void TIMER_A | ( | void | ) |
Definition at line 205 of file comp_b_ex5_TAx.c.
References __no_operation(), GPIO_setOutputHighOnPin(), GPIO_setOutputLowOnPin(), initUpModeParam, temp, and TIMER_A_PERIOD.
| Timer_A_initUpModeParam initUpModeParam = {0} |
Definition at line 71 of file comp_b_ex5_TAx.c.